package com.ltt.service.impl;

import com.ltt.dao.pojo.Plan;
import com.ltt.mapper.PlanMapper;
import com.ltt.service.PlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PlanServiceImpl implements PlanService {

    @Autowired
    private PlanMapper planMapper;

    @Override
    public List<Plan> findPlanByTime(String date, String openId) {
        List<Plan> plans = planMapper.findPlanByTime(date, openId);
        return plans;
    }

    @Override
    public boolean setPlan(Plan plan) {
        int res = planMapper.setPlan(plan);
        return res > 0;
    }

    @Override
    public boolean checkPlan(String id) {
        int res = planMapper.checkPlan(id);
        return res > 0;
    }
}
